package com.boot.contoller;

import com.boot.producer.KafkaProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * DESC: kafka测试类
 *
 * @author WangJie
 * @date Created in 2025-03-05 19:42
 */
@RestController
@RequestMapping ("/kafka")
public class KafkaContoller {

    @Autowired
    private KafkaProducer kafkaProducer;

    @RequestMapping ("/send")
    public void send(@RequestBody String message) {
        kafkaProducer.sendMessage(message);
    }
}
